package com.ezmobo.dao.AdminUser;

import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface AdminUserMapper {
	 @Select("select * from admin_user")
	 @ResultMap("com.ezmobo.dao.AdminUser.AdminUserDOMap")
	 public List<AdminUserDO> getAdminUsers();
	
	 @Insert("insert into admin_user (user_id, password) values (#{user.user_id},#{user.password})")
	 @Options(useGeneratedKeys = true, keyProperty = "user.id")
	 public int addAdminUser(@Param("user") AdminUserDO user);
	
	 @Delete("delete from admin_user where user_id = #{userId}")
	 public int deleteUser(@Param("userId") String userId);
	
	 @Update("update admin_user set password = #{user.password} where id = #{user.id}")
	 public int updateUser(@Param("user") AdminUserDO user);
							 	
//	public List<AdminUserDO> getAdminUsers();
//
//	public int addAdminUser(@Param("user") AdminUserDO user);
//
//	public int deleteUser(@Param("userId") String userId);
//
//	public int updateUser(@Param("user") AdminUserDO user);
}
